 function myAxios(config) {
        return new Promise((resolve, reject) => {
            const xhr = new XMLHttpRequest();
            if (config.params) {
                console.log(config.params);
                const paramsObj = new URLSearchParams(config.params);
                console.log(paramsObj.toString());
                config.url += '?' + paramsObj.toString();

            }



            xhr.open(config.method || 'GET', config.url);
            xhr.addEventListener('loadend', () => {
                if (xhr.status >= 200 && xhr.status < 300) {
                    resolve(JSON.parse(xhr.response));
                }
                else {
                    reject(new Error(xhr.response));
                }
            })
            if (config.data) {
                let str = JSON.stringify(config.data);
                xhr.setRequestHeader('Content-Type', 'application/json');
                xhr.send(str);
            }
            else {
                xhr.send();
            }

            console.log(config.url);
        })
    }